package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder builder1 = new StringBuilder();
        StringBuilder builder2 = new StringBuilder("abc");

        String str = "abc";
        StringBuilder builder3 = new StringBuilder(str);
        String str2 = builder3.toString();

        String str3 = "春天来了";
        StringBuilder builder = new StringBuilder(str3);
        builder.append(",草儿绿了");
        System.out.println(builder);
        builder.replace(6,9,"该穿短袖了");
        System.out.println(builder);

        builder.delete(3,5);
        System.out.println(builder);

        builder.insert(1,"spring");
        System.out.println(builder);
    }
}
